package org.item.redis.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.item.common.service.IRedisService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.security.Key;

@Service
@DubboService
public class RedisService implements IRedisService {
    @Autowired
    RedisTemplate<String,Object> redisTemplate;
    @Override
    public void set(String key, Object value) {
        redisTemplate.opsForValue().set(key,value);
    }

    @Override
    public boolean delete(String key) {
        return redisTemplate.delete(key);
    }

    @Override
    public Object get(String key) {
        Object result=redisTemplate.opsForValue().get(key);
        return result;
    }
}
